[staticanalysis]: Add assertion to pacify analyzer
authorColin Walters <walters@verbum.org>
Sat, 21 Jun 2014 21:28:54 +0000 (17:28 -0400)
committerColin Walters <walters@verbum.org>
Sat, 21 Jun 2014 22:08:49 +0000 (18:08 -0400)
This condition can't actually be hit, let's hint that's the case.

https://bugzilla.gnome.org/show_bug.cgi?id=732020

src/libostree/ostree-repo-commit.c

index b95537071826ba80001441623ed424bf0a01e26a..3ae8ae24877af39c71f1cc77c53e84f2a0fa3996 100644 (file)
@@ -368,11 +368,11 @@ write_object (OstreeRepo         *self,
   gsize unpacked_size = 0;
   gboolean indexable = FALSE;
 
+  g_return_val_if_fail (expected_checksum || out_csum, FALSE);
+
   if (g_cancellable_set_error_if_cancelled (cancellable, error))
     return FALSE;
 
-  g_assert (expected_checksum || out_csum);
-
   if (expected_checksum)
     {
       if (!_ostree_repo_has_loose_object (self, expected_checksum, objtype,
@@ -522,6 +522,8 @@ write_object (OstreeRepo         *self,
           goto out;
         }
     }
+
+  g_assert (actual_checksum != NULL); /* Pacify static analysis */
           
   if (indexable)
     {